package com.yuanfeng.service.impl;

import java.io.Serializable;
import java.util.List;

import com.yuanfeng.dao.ICustomerDao;
import com.yuanfeng.pojo.Customer;
import com.yuanfeng.service.ICustomerService;

public class CustomerService implements ICustomerService {
	
	// 注入dao
	private ICustomerDao customerDao;
	public void setCustomerDao(ICustomerDao customerDao) {
		this.customerDao = customerDao;
	}
	

	@Override
	public void delete(Serializable id) {
		customerDao.delete(id);
	}

	@Override
	public Customer findById(Serializable id) {
		return customerDao.findById(id);
	}

	@Override
	public List<Customer> getAll() {
		List<Customer> list = customerDao.getAll();
		return list;
	}

	@Override
	public void save(Customer t) {
		customerDao.save(t);
	}

	@Override
	public void update(Customer t) {
		customerDao.update(t);
	}
	
	@Override
	public List<Customer> getByStatus(int status) {
		String hql = "from Customer where status=?";
		return customerDao.getByCondition(hql, status);
	}

}







